package com.sky.controller.admin;

import com.sky.result.Result;
import com.sky.service.WorkbenchService;
import com.sky.vo.BusinessDataVO;
import com.sky.vo.DishOverViewVO;
import com.sky.vo.OrderOverViewVO;
import com.sky.vo.SetmealOverViewVO;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * Created with IntelliJ IDEA.
 *
 * @Author: HuoXu
 * @Date: 2023/09/18/11:35
 * @Description: 快乐跳跳虎
 */
@RestController
@RequestMapping("/admin/workspace")
@Slf4j
public class WorkbenchController {
    @Autowired
    private WorkbenchService workbenchService;

    /**
     * 获取今日运营数据
     * @return
     */
    @GetMapping("/businessData")
    @ApiOperation("获取今日运营数据")
    public Result<BusinessDataVO> operationalData(){
        log.info("进入获取运营数据的接口");
        BusinessDataVO businessDataVO=workbenchService.operationalData();
        return Result.success(businessDataVO);
    }

    /**
     * 查询套餐总览
     * @return
     */
    @GetMapping("/overviewSetmeals")
    public Result<SetmealOverViewVO> setmealOverView(){
        log.info("获取套餐总览");
        return Result.success(workbenchService.getSetmealOverView());
    }

    /**
     * 查询菜品总览
     * @return
     */
    @GetMapping("/overviewDishes")
    public Result<DishOverViewVO> dishOverView(){
        log.info("获取菜品数总览");
        return Result.success(workbenchService.getDishOverView());
    }

    /**
     * 查询订单管理数据
     * @return
     */
    @GetMapping("/overviewOrders")
    public Result<OrderOverViewVO> orderOverView(){
        return Result.success(workbenchService.getOrderOverView());
    }
}
